home *** CD-ROM | disk | FTP | other *** search
- Path: hydra.zrz.TU-Berlin.DE!rawneiha
- From: rawneiha@hydra.zrz.TU-Berlin.DE (Philipp Boerker)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: TMapping again!
- Date: 20 Feb 1996 15:43:24 GMT
- Organization: Technical University Berlin, Germany
- Message-ID: <4gcq6s$b1h@brachio.zrz.TU-Berlin.DE>
- References: <38232371@kone.fipnet.fi> <4fntd3$g56@sunsystem5.informatik.tu-muenchen.de> <38232442@kone.fipnet.fi> <4fvnjb$gdm@oreig.uji.es> <4g147q$sit@maureen.teleport.com> <4ga6lr$rp8@brachio.zrz.TU-Berlin.DE> <4gc5ur$brr@maureen.teleport.com>
- NNTP-Posting-Host: hydra.zrz.tu-berlin.de
-
- >: > I would unroll the innerloop, you probably can save hundreds of dbra
-
- >: If you have an object with let's say 5000 polys umrolling will mean
- >: a big overhead because of the treatment of "pixels modulo unrolling".
- >: You may never enter that unrolled loop!
-
- > What do you mean by "pixel modulo unrolling"? Never enter the loop?!?!
- > then you dont draw any pixels so its VERY fast :)
-
- if you do a innerloop mapping 16 pixels at once you need to map
- number_of_pixels_you_have_to_map % 16 independently. For instants
- 45 pixels to map would result in 2 executions of your 16 pixel loop
- plus 13 executions of 1-pixel loop. number_pixel < 16 will not make use
- of your loop at all!
-
- > Its true that there is some overhead, But here is an example:
-
- > ...
- > moveq #%1111,d3 ;2
- > and.w d2,d3 ;2
- > neg.w d3 ;2
- > lsr.w #4,d2 ;4
- > jmp (.z,pc,d3.w*8) ;10 = 20 per scanline
- > .. REPEAT 16
- ^^ what a great label :)
-
- > move.b (a0,d0.w),(a1)
- > addx.l d1,d0
- > adda.l a2,a1
- > ENDR
- >.z dbra d2,.. ;6 per pixel
- > ...
-
- Hm, this is a wall mapping loop, I thought we were talking about
- polygon mapping, where you have lots of polys smaller than 16 pixels width
- if you do *many* polys (therefor the number 5000).
-
- > now if this 'polygon' is more then 4 pixel height its worth it... well,
- > if its a few pixel width too :)
-
- ??? to use this loop you will have to have more than 16 pixels!
- The treatment of number_pixels mod 16 will add a big overhead for small
- polys, like I said above.
-
-
- > If the poly where to be ~4x4 pixel I would think rendering then using
- > the average color of the texture (precalculated of course) and use a
- > flat shading function (using also the average of the light value at the
- > triangle vertices
-
- You will hardly stuff all that into your 256 B cache. According to my
- experience it is better to have an ordinary loop and outer loops in cache
- than spending the cache for case-optimized loops.
-
- Greets,
- Phil.
- grond/matrix
-
-